#include "mynetworkaccessmanager.h"

myNetworkAccessManager::myNetworkAccessManager(QObject *parent)
    : QNetworkAccessManager(parent)
{
}

myNetworkAccessManager::myNetworkAccessManager(QNetworkAccessManager *manager, QObject *parent)
    : QNetworkAccessManager(parent)
{
    setCache(manager->cache());
    setCookieJar(manager->cookieJar());
    setProxy(manager->proxy());
    setProxyFactory(manager->proxyFactory());
}

QNetworkReply *myNetworkAccessManager::createRequest(
    QNetworkAccessManager::Operation operation, const QNetworkRequest &request,
    QIODevice *device)
{
    if (request.url().scheme() != "myspaces")
        return QNetworkAccessManager::createRequest(operation, request, device);

    if (operation == GetOperation)
        return new myReply(request.url());
    else
        return QNetworkAccessManager::createRequest(operation, request, device);
}
